import React from 'react'
import {Empty} from 'antd-mobile'
import "./ListMenu.less"

export default function ListMenu(props) {
    let { listmenu,onChangeN,n } = props
    return (
        <div >
            {listmenu.length==0? <Empty description='暂无数据'/>:
            <ul className='list_menu'>
                {listmenu.map((item,index) => {
                    return <li 
                    className={n==index?"active":""} 
                    key={item.id}
                    onClick={() => {onChangeN(index)}}
                    >{item.catename}</li>
                })}
            </ul>
            }
        </div>
    )
}
